<template>
	<div>
		<!-- 头部 -->
		<!-- <div class="header">
			<el-row style="padding: 5px 0 0 0;">
				<el-col :span="4">
					资质名称:
					<el-input v-model="aName" placeholder="请输入内容" style="width: 200px;"></el-input>
				</el-col>
				<el-col :span="4">
					资质id:
					<el-input v-model="aId" placeholder="请输入内容" style="width: 200px;"></el-input>
				</el-col>
				<el-col :span="2">
					<el-button size="mini" @click="selectLike"
						style="width: 90px;height: 40px;background-color: #00A0FF;color: #fff;">
						查询结果</el-button>
				</el-col>
			</el-row>
		</div> -->
		<el-table :header-cell-style="{'text-align':'center'}" :cell-style="{ textAlign: 'center' }"
			:data="advertisersList.records" stripe style="width: 100% width: 80%;margin: auto">
			<el-table-column property="violationId" label="违规编号">
			</el-table-column>
			<el-table-column property="remark" label="类型">
			</el-table-column>
			<el-table-column property="userId" label="违规账号">
			</el-table-column>
			<el-table-column property="pitcherId" label="投手">
			</el-table-column>
			<el-table-column property="forbiddenData" label="封禁时间">
			</el-table-column>
			<el-table-column property="deblocKingData" label="解封时间">
			</el-table-column>
			<el-table-column property="score" label="扣分">
			</el-table-column>
			<el-table-column property="violation" label="封禁内容">
			</el-table-column>
			<el-table-column property="type" label="封禁类型">
			</el-table-column>
			<el-table-column property="forbiddenReason" label="封禁理由">
			</el-table-column>
			<el-table-column label="封禁素材" width="300">
				<div slot-scope="scope">
					<template>
						<template>
							<el-popover placement="bottom-start" width="320" trigger="click"
								:visible.sync="popoverVisible">
								<img slot="reference" :src="scope.row.cover" style="width: 150px; height: 250px;">
								<video :src="scope.row.materialId"
									style="width: 300px; height: auto; background-color: #fff;" controls></video>
							</el-popover>
						</template>
					</template>
				</div>
			</el-table-column>
			
			<el-table-column label="操作">
				<el-row slot-scope="scope">
					<el-col span="6"><el-button type="text" size="mini"
							@click=" viewAccount(scope.row.id)">查看账号</el-button></el-col>
					<el-col span="18"><el-button type="text" size="mini"
							@click="deletes(scope.row.id)">删除</el-button></el-col>
				</el-row>
			</el-table-column>
		</el-table>
		<div>
			<el-row style="margin: 20px 0;">
				<el-col :span="11">
					<div class="block">
						<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
							:current-page="currentPage4" :page-sizes="[10, 20, 50, 100]" :page-size="10"
							layout="total, sizes, prev, pager, next, jumper" :total="advertisersList.total">
						</el-pagination>
					</div>
				</el-col>
			</el-row>
		</div>
	</div>
</template>

<script>
	import '@/assets/css/index.css'
	import qs from 'qs'
	export default {
		name: "qu",
		data() {
			return {
				advertisersList: [],
				resourceCategory: [],
				aName: '',
				aId: '',
				role: '',
				categoryIds: '',
				dialogVisible: false,
				description: '',
				title: '',
				resource: [],
				roleDescriptions: {

				},
				size:10,
				current:1
			}
		},
		created() {
			let than = this
			this.$axios.post('umsAdvertisingUserForbidden/list',qs.stringify({size:than.size,current:than.current})).then((res) => {
				than.advertisersList = res.data;
				console.log(than.advertisersList)
			})
		},
		methods: {
			viewAccount(id) {
				this.$router.push({
					name: 'advertisingUser',
					params: {
						accountId: id
					}
				});
			},
			handleSizeChange(val) {
				let that = this
				this.$axios.post('umsAdvertisingUserForbidden/list', qs.stringify({
					size: val,
					current: 1,
				})).then((res) => {
					that.advertisersList = res.data;
					console.log(that.advertisersList)
				})
			},
			handleCurrentChange(val) {
				let that = this;
				this.$axios.post('umsAdvertisingUserForbidden/list', qs.stringify({
					size: that.advertisersList.size,
					current: val,
				})).then((res) => {
					that.advertisersList = res.data;
				})
			},

			selectLike() {
				let that = this
				this.$axios.post('umsAdvertisingUserType/list', qs.stringify({
					size: 10,
					current: 1,
					name: that.aName,
					id: that.aId
				})).then((res) => {
					that.advertisersList = res.data;
					console.log(that.advertisersList)
				})
			},
		}
	}
</script>

<style>
	.header {
		width: auto;
		height: 50px;
		border: 1px solid #ddd;
		margin: 15px auto;
		border-radius: 3px 3px;
		position: relative;
	}
</style>